package com.example.cobodynamicproxydemo.controller;

import com.example.cobodynamicproxydemo.data.UserDto;
import com.example.cobodynamicproxydemo.service.UserApiDemoClient;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigInteger;
import java.util.List;

@RestController
@RequestMapping("/api/v1/user")
public class UserController {

    @Resource
    private UserApiDemoClient userApiProxyClient;


    @GetMapping("list")
    public List<UserDto> list() {
        return userApiProxyClient.list();
    }

    @GetMapping("findById")
    public UserDto findById(BigInteger id) {
        return userApiProxyClient.findById(id);
    }


}
